library(ggplot2)
data("diamonds")
qplot(depth, data = diamonds)
qplot(depth, data = diamonds, xlim=c(55, 70), binwidth = 0.2)
qplot(depth, data = diamonds, xlim=c(55, 70), binwidth = 0.2) + facet_grid(~ cut)
qplot(depth, data = diamonds, xlim=c(55, 70), binwidth = 0.2, color=cut)
### Wyświetl histogram zmiennej price
qplot(price, data = diamonds, xlim = c(0, 15000), binwidth = 20)
qplot(price, data = diamonds, xlim = c(0, 15000), binwidth = 20, color=cut)
qplot(price, data = diamonds, xlim = c(0, 15000), binwidth = 20) + facet_grid(~ cut)
install.packages("plotly")
library(plotly)
p <- ggplot(diamonds, aes(carat, price, color=clarity))+ geom_point()
ggplotly(p)